<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>节点信息</title>
    <link rel="shortcut icon" href="favicon.ico">
    <script src="/static/js/jquery.min.js?v=2.1.4"></script>
    <script src="/static/js/base.js"></script>
    <link rel="stylesheet" href="/static/layui/css/layui.276.css" media="all">
    <script src="/static/layui/layui.2.7.6.js"></script>



</head>
<body>

<!-- 编辑节点 -->
<div class="layui-card" id="edit_box" style="padding: 20px;">
    <div class="layui-card-body">
        <form class="layui-form" action=""  lay-filter="edit-form">
            <input type="hidden" name="id" id="id"/>
            <div class="layui-form-item">
                <label class="col-sm-3 layui-form-label">节点名称：</label>
                <div class="layui-input-block col-sm-7">
                    <input id="e_node_name" type="text" class="layui-input" name="node_name" required>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="col-sm-3 layui-form-label">控制器名：</label>
                <div class="layui-input-block col-sm-7">
                    <input id="e_control_name" type="text" class="layui-input" name="control_name" required placeholder="全小写">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="col-sm-3 layui-form-label">方法名：</label>
                <div class="layui-input-block col-sm-7">
                    <input id="e_action_name" type="text" class="layui-input" name="action_name" required placeholder="全小写">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="col-sm-3 layui-form-label">是否是菜单项：</label>
                <div class="layui-input-block col-sm-7">
                    <select  name="is_menu" lay-verify="required" id="e_is_menu">
                        <option value="0">否</option>
                        <option value="1">是</option>
                    </select>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="col-sm-3 layui-form-label">菜单图标：</label>
                <div class="layui-input-block col-sm-7">
                    <input id="e_style" type="text" class="layui-input" name="style" placeholder="只有顶级节点需要">
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" layui-submit lay-filter="formEdit"  type="submit">提交</button>
                </div>
            </div>
        </form>

    </div>
</div>

<script type="text/javascript">
    var currentNode = null;
    layui.use(['tree', 'util','layer','form'], function(){
        var form = layui.form,util=layui.util,layer=layui.layer,tree=layui.tree;
        //提交
        form.on('submit(formAdd)', function(data){

            layer.msg(JSON.stringify(data.field));
            return false;
        });
        form.on('submit(formEdit)', function(data){
            alert('ddd')
            console.log(JSON.stringify(data.field))
            layer.msg(JSON.stringify(data.field));
            return false;
        });

    });

</script>

</body>
</html>